package com.edu.chat.web.controller;

import com.edu.chat.facade.model.dto.HistoryMsgDTO;
import com.edu.chat.web.common.model.R;
import com.edu.chat.web.controller.vo.QueryMsgVO;
import com.edu.chat.web.service.CsMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: KQAIA
 * @description:
 * @author: 无恙
 * @create: 2025-04-10 23:04
 **/

@Slf4j
@RestController
@RequestMapping("/chat/message")
public class MessageController {

	@Autowired
	private CsMessageService csMessageService;

	/**
	* 游标滚动查询历史消息
	* @Date: 2025/4/10
	*/
	@RequestMapping("/query")
	public R<?> queryHistoryMsg(@RequestBody @Validated QueryMsgVO queryMsgVO){


		List<HistoryMsgDTO> historyMsgDTOS = csMessageService.queryMsgListByScroll(queryMsgVO);

		return R.success(historyMsgDTOS);
	}



}
